var dom = document.getElementById("p_pie");
/* var resizeWorldMapContainer = function() {
	dom.style.width = window.innerWidth + 'px';
	dom.style.height = window.innerHeight + 'px';
};
//设置容器高宽
resizeWorldMapContainer(); */

var myChart = echarts.init(dom);
var app = {};
var option;
option = {
	dataset: {
		source: [{
				value: 1048,
				name: '大乐透',
				label: {
					color: "#b1bcff",
					fontSize: 15,
					edgeDistance: 10,
					lineHeight: 20,
				}
			},
			{
				value: 735,
				name: '传足',
				label: {
					color: "#b1bcff",
					fontSize: 15,
					edgeDistance: 10,
					lineHeight: 20,
				}
			},
			{
				value: 735,
				name: '顶呱呱',
				label: {
					color: "#b1bcff",
					fontSize: 15,
					edgeDistance: 10,
					lineHeight: 20,
				}
			},
			{
				value: 735,
				name: '排5',
				label: {
					color: "#b1bcff",
					fontSize: 15,
					edgeDistance: 10,
					lineHeight: 20,
				}
			},
			{
				value: 735,
				name: '排3',
				label: {
					color: "#b1bcff",
					fontSize: 15,
					edgeDistance: 10,
					lineHeight: 20,
				}
			},
			{
				value: 735,
				name: '即开',
				label: {
					color: "#b1bcff",
					fontSize: 15,
					edgeDistance: 10,
					lineHeight: 20,
				}
			},
			{
				value: 735,
				name: '七星彩',
				label: {
					color: "#b1bcff",
					fontSize: 15,
					edgeDistance: 10,
					lineHeight: 20,
				}
			},
			{
				value: 580,
				name: '竞彩',
				label: {
					color: "#b1bcff",
					fontSize: 15,
					edgeDistance: 10,
					lineHeight: 20,
				}
			}
		]
	},
	series: [{
		type: 'pie',
		center: ['50%', '50%'],
		radius: ['30%', '60%'],
		data: focus.source,
		label: {
			formatter: '{b}:{d}% ',
			
		},
		itemStyle: {
			normal: {
				color: function(params) {
					let colors = [
						'#333dff', '#e744ff', '#fff32d','#ffa32c','#78d638','#33ffb8','#33c8ff','#3377ff'
					];
					return colors[params.dataIndex]
				}
			}
		},

	}]
};

if (option && typeof option === 'object') {
	myChart.setOption(option);
};

//用于使chart自适应高度和宽度
/* window.onresize = function() {
	//重置容器高宽
	resizeWorldMapContainer();
	myChart.resize();
}; */
